﻿<div>
    <div class="title-bold-18 green">
        {{governanceForCompany.companyName}}
    </div><br />
    <div class="title-bold-16">
        Company profile
    </div>
    <div class="table">
        <div class="table-row">
            <div class="table-head width_370" style="width: 526px;"> Governance Report Name</div>
            <div class="table-head width_250">Actions</div>
        </div>
        <!--Business and Financial Profile-->
        <div class="table-row ng-scope" ng-show="!governanceForCompany.hasBusinessAndFinancialProfile">
            <div class="table-col width_370" style="width: 526px;">The company does not have a Business and Financial Profile</div>
            <div class="table-col width_250" style="text-align: right;">
                <input type="file" ng-file-select="governanceForCompany.onSelectPdf($files, 0)" accept=".pdf" />
            </div>
        </div>
        <div class="table-row ng-scope" ng-show="governanceForCompany.hasBusinessAndFinancialProfile">
            <div class="table-col width_370" style="width: 526px;">
                {{governanceForCompany.businessAndFinancialProfile.corporateGovernancePdfProfileString}} -
                {{governanceForCompany.businessAndFinancialProfile.updateOperationTypeString}} on:
                {{governanceForCompany.businessAndFinancialProfile.lastOperationDate | date: 'MMM d, y'}}
            </div>
            <div class="table-col width_250">
                <button ng-file-select="governanceForCompany.onSelectPdf($files, 0);" accept=".pdf" ng-multiple="false" class="button-lynks" style="margin-right: 70px">Edit</button> <!--class="button-lynks"-->
                <button class="button-lynks" ng-click="governanceForCompany.deletePdfProfile(governanceForCompany.businessAndFinancialProfile)">Delete</button>
                <button class="button-lynks"
                        ng-click="governanceForCompany.downloadGovernancePdfS3(governanceForCompany.businessAndFinancialProfile)">
                    Download PDF
                </button>
            </div>
        </div>
        <!-- Governance Data Profile-->
        <div class="table-row ng-scope" ng-show="!governanceForCompany.hasGovernanceDataProfile">
            <div class="table-col width_370" style="width: 526px;">The company does not have a Corporate Data Profile</div>
            <div class="table-col width_250" style="text-align: right;">
                <input type="file" ng-file-select="governanceForCompany.onSelectPdf($files, 1);" accept=".pdf" />
            </div>
        </div>
        <div class="table-row ng-scope" ng-show="governanceForCompany.hasGovernanceDataProfile">
            <div class="table-col width_370" style="width: 526px;">
                {{governanceForCompany.governanceDataProfile.corporateGovernancePdfProfileString}} -
                {{governanceForCompany.governanceDataProfile.updateOperationTypeString}} on:
                {{governanceForCompany.governanceDataProfile.lastOperationDate | date: 'MMM d, y'}}
            </div>
            <div class="table-col width_250">
                <button ng-file-select="governanceForCompany.onSelectPdf($files, 1);" accept=".pdf" ng-multiple="false" class="button-lynks" style="margin-right: 70px">
                    <span class="pointer">Edit</span>
                </button>
                <button class="button-lynks" ng-click="governanceForCompany.deletePdfProfile(governanceForCompany.governanceDataProfile)">Delete</button>
                <button class="button-lynks"
                        ng-click="governanceForCompany.downloadGovernancePdfS3(governanceForCompany.governanceDataProfile, true)">
                    Download PDF
                </button>
            </div>
        </div>
    </div>
    <br />
    <div ng-if="governanceForCompany.hasProfile">
        Company has full profile: 
        <span style="font-weight:bold;">{{governanceForCompany.companyProfile.fullProfile? 'YES' : 'NO' }}</span>
        <br/>
    </div>    
    <br />
    <div class="title-bold-16">
        Insights
    </div>
    <div class="table" ng-show="governanceForCompany.companyProfile.insights.length > 0">
        <div class="table-row">
            <div class="table-head width_130">Publication date</div>
            <div class="table-head width_200">Title</div>
            <div class="table-head width_190">Created By</div>
            <div class="table-head width_250">Actions</div>
        </div>
        <div class="table-row ng-scope" ng-repeat="item in governanceForCompany.companyProfile.insights">
            <div class="table-col width_130">{{item.publicationDate | date: 'MMM d, y'}}</div>
            <div class="table-col width_200">{{item.title}}</div>
            <div class="table-col width_190">{{item.createdBy}}</div>
            <div class="table-col width_250">
                <button class="button-lynks" ng-click="governanceForCompany.editInsight(item)">Edit</button>
                <button class="button-lynks" ng-click="governanceForCompany.deleteInsight(item)">Delete</button>
                <button class="button-lynks"
                        ng-click="governanceForCompany.downloadGovernanceInsightsPdfS3(item)"
                        ng-disabled="!governanceForCompany.downloadGovernanceFileEnabled(item.fileId, item.fileName)"
                        style="margin-right: 0;">
                    Download PDF
                </button>
            </div>
        </div>
    </div><br />
    <div ng-show="!governanceForCompany.hasProfile">Please add the profile before creating insights.</div>
    <button class="btn-green" ng-disabled="!governanceForCompany.hasProfile" ng-click="governanceForCompany.addInsight()">Add New Insight</button>
</div>
